/**
 * 获取对应cookie值
 *
 * @example
 *  var ck = getCookie('name')     // angelzou
 *
 * @export
 * @param {string} name 要获取的cookie名
 * @returns {string} 获取的cookie值
 */
export function getCookie(name) {
  const r = new RegExp(`(?:^|;+|\\s+)${encodeURIComponent(name)}=([^;]*)`);
  const m = document.cookie.match(r);
  return !m ? '' : decodeURIComponent(m[1]);
}
